package com.lx.cloud.controller;

import com.lx.cloud.feign.TestFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Locale;

/**
 * @ClassName TestController
 * @Description
 * @Author ymy
 * @Date 2021/2/20 9:43
 */
@RestController
@Slf4j
public class TestController {

    @Autowired
    private TestFeign testFeign;


    @Value("${server.port}")
    private String port;

    @Value("${spring.application.name}")
    private String applicationName;

    @GetMapping(value = "/test")
    public String test(){

        return "hello, 端口："+port+",服务名："+applicationName;
    }

    @GetMapping(value = "/feignTest")
    public String feignTest(String name){
        log.info("进入cloud-client1");
        return testFeign.test(name);
    }


}
